/*!
\copyright  Copyright (c) 2023 Qualcomm Technologies International, Ltd.\n
            All Rights Reserved.\n
            Qualcomm Technologies International, Ltd. Confidential and Proprietary.
\file       a2dp_profile_event.h
\brief      Events sent by the A2DP profile
*/

#ifndef A2DP_PROFILE_CHANNEL_EVENT_SPEC_H_
#define A2DP_PROFILE_CHANNEL_EVENT_SPEC_H_

#include "channel_event_spec_ids.h"
#include <bdaddr.h>

/*! @{ */

/*! \brief The A2DP profile event channel */
#define EVENT_BUS_CHANNEL_A2DP_PROFILE  a2dp_profile_event_channel

/*! \brief The A2DP profile events that are sent. */
typedef enum
{
    a2dp_profile_event_a2dp_open,
    a2dp_profile_event_a2dp_codec_configured,
    a2dp_profile_event_a2dp_close,
    a2dp_profile_event_a2dp_streaming,
    a2dp_profile_event_a2dp_suspended,
    a2dp_profile_event_a2dp_ttp_latency_change,
} a2dp_profile_event_t;

/*! \brief The supported A2DP profile codecs. */
typedef enum
{
    a2dp_profile_event_codec_type_invalid,
    a2dp_profile_event_codec_type_sbc,
    a2dp_profile_event_codec_type_aac,
    a2dp_profile_event_codec_type_aptx,
    a2dp_profile_event_codec_type_aptx_adaptive,
    a2dp_profile_event_codec_type_aptx_hd,
    a2dp_profile_event_codec_type_vendor,
} a2dp_profile_event_codec_type_t;

 /*! \brief The data sent with the a2dp_profile_event_a2dp_open event. */
typedef struct
{
    bdaddr addr;
}  a2dp_profile_event_a2dp_open_t;

/*! \brief The data sent with the a2dp_profile_event_a2dp_codec_configured event. */
typedef struct
{
    bdaddr addr;
    a2dp_profile_event_codec_type_t codec_type;
    /*! The configured sample rate of the A2DP media stream */
    uint32_t sample_rate;
    /*! The configured bit depth of each sample. 0 if this is unkown */
    uint8_t sample_bit_depth;
}  a2dp_profile_event_a2dp_codec_configured_t;

/*! \brief The data sent with the a2dp_profile_event_a2dp_close event. */
typedef struct
{
    bdaddr addr;
}  a2dp_profile_event_a2dp_close_t;

/*! \brief The data sent with the a2dp_profile_event_a2dp_streaming event. */
typedef struct
{
    bdaddr addr;
}  a2dp_profile_event_a2dp_streaming_t;

/*! \brief The data sent with the a2dp_profile_event_a2dp_suspended event. */
typedef struct
{
    bdaddr addr;
}  a2dp_profile_event_a2dp_suspended_t;

/*! \brief The data sent with the a2dp_profile_event_a2dp_ttp_latency_change event. */
typedef struct
{
    uint16_t target_ms;
} a2dp_profile_event_absolute_ttp_latency_change_t;

/*! @} */

#endif /* A2DP_PROFILE_CHANNEL_EVENT_SPEC_H_ */
